package controller;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.ibatis.logging.Log;
import org.apache.ibatis.logging.LogFactory;
import org.apache.ibatis.session.SqlSession;

import SessionFactory.Config;
import dao.UserMapper;
import model.User;

public class UserController {
	
	final static Log log = LogFactory.getLog(UserController.class);
	final static Logger log2 = Logger.getLogger(UserController.class.getName());
	
	public static void main(String[] args) {
		List<User> list;
		SqlSession session = Config.getSession();
		
		/*list = session.selectList("findAllUser");
		System.out.println(list);
		
		System.out.println("===============");*/
		
		UserMapper um = session.getMapper(UserMapper.class);
		list = um.getAllUser();
		System.out.println(list);
		User us = um.getOneUser(2);
		System.out.println(us);
		
		log.error("this is log test...");
		log2.log(Level.SEVERE,"this is log2 test...");
	}
	
}
